<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateWithdrawalsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('withdrawals', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('withdrawal_sn')->comment('提现单号');
            $table->string('payment_no')->comment('微信订单号')->nullable();
            $table->unsignedBigInteger('member_id')->comment('用户id');
            $table->decimal('withdrawal_amount',10,2)->comment('提现金额');
            $table->string('realname')->comment('真实姓名');
            $table->string('desc')->comment('备注信息');
            $table->tinyInteger('status')->comment('状态 1 已完成 2 待提现 3 提现失败 ')->default(2);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('withdrawals');
    }
}
